<?php
/**
 * Created by PhpStorm.
 * User: yellow
 * Date: 2019/4/29
 * Time: 14:23
 */

namespace app\common\model;


use think\Model;

class Role extends Model
{

    public function operations(){
        return $this->belongsToMany('Operation', '\\app\\common\\model\\RoleOperation', 'operation_id', 'role_id');
    }

    public function setStatusAttr($value){
        if ($value){
            return 1;
        } else{
            return 0;
        }
    }

    public function getCreateTimeAttr($value){
        return date('Y-m-d H:i', $value);
    }


}